import request from '@/utils/request'

enum Api {
  list = '/patrolJobDefect/loadList'
}

/**
 * 列表
 * @param data
 */
export const list = async (data: {
  pageNum: number
  pageSize: number
  algTimeBegin: string
  algTimeEnd: string
  defectResult: string
  deviceName: undefined
}) => {
  return await request.post(Api.list, { data })
}

/**
 * 设备列表
 * @param
 */
export const getDevList = async () => {
  return await request.get('/patrolJobDefect/getDeviceNameList')
}

/**
 * 详情列表
 * @param data
 */
export const detailList = async (data: {
  pageNum: number
  pageSize: number
  deviceId: string
}) => {
  return await request.post('/patrolJobDefect/loadDetailList', { data })
}

/**
 * 加载部件缺陷详情
 * @param id
 */
export const loadDefectDetail = async (params: { id: number }) => {
  return await request.get('/patrolJobDefect/loadDetailInfo', { params })
}
